package com.设计模式.state1;

/**
 * @Date 2022/9/7 22:45
 * @Author WangLinBao
 * @Description
 */
public class NoRaffleState extends State{

    RaffleActivity activity;

    public NoRaffleState(RaffleActivity activity) {
        this.activity = activity;
    }


    @Override
    void reduceMoney() {
        System.out.println("扣除50积分成功,可以进行抽奖");
        //进入下一状态
        activity.setState(activity.canRaffleState);
    }

    @Override
    boolean raffle() {
        System.out.println("需要先扣除积分才能抽奖");
        return false;
    }

    @Override
    void dispense() {

        throw new RuntimeException("流程错误");
    }
}
